<%
  #File:    /app/views/manage/documents/_list_files.rhtml
  #Author:  Andrew Stone
  #Created: 08.25.2006
%>

<div id="sub_container">
  <table>
    <thead>
      <tr>
        <td>Title</td>
        <td>Version</td>
        <td>Kb</td>
        <td>Date/Time</td>
        <td>Actions</td>
      </tr>
    </thead>
    <tbody>
    <%
      if @category.document.length == 0 %>
        <tr>
          <td class="nodata" colspan="3">No documents associated with this category</td>
        </tr>
    <% 
      else
        @category.document.each do |doc| %>
          <tr>
            <td class="data"><%=h(doc.title)%></td>
            <td class="data"><%=doc.current_version.version%></td>
            <td class="data"><%=doc.current_version.kilobytes%></td>
            <td class="data"><%=mmddyyyy(doc.current_version.updated_at)%></td>
            <td>
              <%
                links = []
                links << secure_link_to("Update",ca("/manage/documents","manage_file_versions",doc.id))
                links << secure_link_to("Delete",ca("/manage/documents","delete_file",doc.id),:confirm => "Are you sure?")
              %>
              <%=secure_links(links)%>
            </td>
          </tr>
    <% 
        end
      end %>
    </tbody>
  </table>
</div>

